<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="u" uri="/WEB-INF/tld/unit.tld" %>
 <title>正在打印</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script language="javascript" src="${basePath }/js/LodopFuncs.js"></script>
<object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
	<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="${basePath }/jsp/print/install_lodop.exe"></embed>
</object> 
</head>
<body>
	<div id="image_print">
		<img width="70px" src="${basePath }/image/fhh01.jpg"></img>
	</div>
	<div id="line_print" style="width:200px;">
		-------------------------------------------------------
	</div>
	<div id="mian_print">
			<div align="center" style="font-size:10px;">
			= = = = = = = = = = = = = = = = = = 
			</div>
			<div style="margin-left:10px;margin-right:10px;">
			<c:if test="${detail.hall eq null }">
              <table  width="180" style="font-size:10px;">
                  <tr class="">
                    <th  align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编号</th>
                    <th align="center">包间名称</th>
                    <th align="center">小计</th>
                  </tr>
                  <tr class="">
                    <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${detail.room.id }</td>
                    <td align="center">${detail.room.name }</td>
                    <td align="center">${detail.order.area_sub_display }</td>
                  </tr>
              </table>
			<div align="center" >
			-------------------------
			</div>
      		</c:if>
      	<c:if test="${detail.room eq null }">
              <table  width="180" style="font-size:10px;">
                  <tr class="">
                    <th  align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编号</th>
                    <th align="center">座位名称</th>
                    <th align="center">小计</th>
                  </tr>
                  <tr class="">
                    <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${detail.hall.id }</td>
                    <td align="center">${detail.hall.hall_name }</td>
                    <td align="center">${detail.order.area_sub_display }</td>
                  </tr>
              </table>
               <div align="center" >
			-------------------------
			</div>
      </c:if>
              <table  width="180" style="font-size:10px;">
                  <tr class="">
                    <th align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商品名称</th>
                    <th align="center">单价*数量</th>
                    <th align="center">小计</th>
                  </tr>
                  <c:forEach items="${detail.teas }" var="tea">
                  <tr class="">
                    <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${tea.goods_title }</td>
                    <td align="center">${tea.goods_price_display }*${tea.goods_num }</td>
                    <td align="center">${tea.amount }</td>
                  </tr>
                  </c:forEach>
              </table>
               <div align="center" >
			-------------------------
			</div>
              <table  width="180" style="font-size:10px;">
                  <tr class="">
                    <th align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商品名称</th>
                    <th align="center">单位</th>
                    <th align="center">小计</th>
                  </tr>
                  <c:forEach items="${detail.sampleteas }" var="tea">
                  <tr class="">
                    <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${tea.goods_title }</td>
                    <td align="center">${tea.unit_display }</td>
                    <td align="center">${tea.amount }</td>
                  </tr>
                  </c:forEach>
              </table>
              <div align="center" >
			-------------------------
			</div>
			<table  width="180" style="font-size:10px;">
		        <tr class="">
		          <th align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名称</th>
		          <th align="center">价格*数量</th>
		          <th align="center">小计</th>
		        </tr>
		        <c:forEach items="${detail.desserts }" var="dessert">
		       <tr class="">
		         <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${dessert.goods_title }</td>
		         <td align="center">${dessert.goods_price }*${dessert.goods_num }</td>
		         <td align="center">${dessert.amount }</td>
		       </tr>
		       </c:forEach>
		        </table>
		    <div align="center" >
			-------------------------
			</div>
			<div style="margin-left:10px;margin-right:10px;font-size:10px;">
				&nbsp;&nbsp;总计：${detail.order.total_sub_display }
		    </div>
			</div>
          <div align="center" style="font-size:10px;">
			= = = = = = = = = = = = = = = = = = 
			</div>
			<div align="center" style="font-size:10px;">
				谢谢您的惠顾，欢迎再次光临！
			</div>
      </div>
</body>
<script type="text/javascript">
	var LODOP;
	cssStyle = "<style>table{font-size:10px;}</style>";
	var LODOP = getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'),'${basePath }');
	if(LODOP.PRINT_INIT("")){
		LODOP.SET_PRINT_PAGESIZE(0,"50mm","150mm","");
		LODOP.ADD_PRINT_IMAGE("0mm","30mm","20mm","20mm",document.getElementById("image_print").innerHTML);
		LODOP.ADD_PRINT_HTM("21mm","0mm","50mm","80mm",document.getElementById("mian_print").innerHTML);
		LODOP.SET_PRINTER_INDEX(-1);
		//LODOP.PREVIEWB();
		LODOP.PRINTB();
	}else{
		alert("打印控件初始化失败，请重新刷新后再试。");
	}
	window.close();
</script>
